/***************************************************************************
 *   Copyleft 2006-2007 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>			                           *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __ABSTRACTWINDOW_H__
#define __ABSTRACTWINDOW_H__

#include <windows.h>
#include <commctrl.h>
#include "../Types/Types.h"
#include "./StatusBar/StatusBar.h"
#include "../Framework/Engine3D.h"

#define WINDOW_WIDTH		800
#define WINDOW_HEIGHT		600

#define WNDMSGHANDLER(Message, FunName)	\
	case (Message):	\
		FunName(hwnd, wParam, lParam);	\
		break;	\


class AbstractWindow {
public:
	Engine3D *mEngine;

	cVoid SetProperty(cInt property, cLong value);
	cVoid SetSize(cInt width, cInt height);
	cVoid SetLocation(cInt x, cInt y, cBool bCenter);

	AbstractWindow(HINSTANCE hInstance, const pcTChar name, const pcTChar title, HWND parent);
	virtual ~AbstractWindow();
	
protected:
	HINSTANCE mhInstance;
	HWND mhWnd;
	StatusBar* mStatusBar;

	static LRESULT CALLBACK MainWndProc(HWND hwnd, cUInt message, WPARAM wParam, LPARAM lParam);
	virtual LRESULT CALLBACK WndProc(HWND hwnd, cUInt message, WPARAM wParam, LPARAM lParam);

	ATOM Register(HINSTANCE hInstance, const pcTChar name);
	ATOM Create(const pcTChar name, const pcTChar title, HWND parent);
};
#endif